package com.bins.uaa.common.vo;

import com.bins.uaa.common.constants.CommonCode;
import com.bins.uaa.common.constants.ResponseBody;
import com.bins.uaa.common.constants.ResponseConstant;
import com.bins.uaa.common.constants.ResponseAction;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@NoArgsConstructor
public class ResponseBaseVo implements ResponseConstant {

    private boolean success = SUCCESS;

    private int code = SUCCESS_CODE;

    private String message;

    public ResponseBaseVo(ResponseAction resultCode) {
        this.success = resultCode.success();
        this.code = resultCode.code();
        this.message = resultCode.message();
    }

    public static ResponseBody SUCCESS() {
        return new ResponseBody(CommonCode.SUCCESS);
    }

    public static ResponseBody FAIL() {
        return new ResponseBody(CommonCode.FAIL);
    }

}
